package com.peng.service;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.peng.mapper.GroupChatMapper;
import com.peng.pojo.Group;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;

@Service
public class GroupChatServiceImp implements GroupChatService {

    @Autowired
    private GroupChatMapper groupChatMapper;

    @Override
    public PageInfo<Group> selectAllGroup(String name, Date time, int page, int size) {
        PageHelper.startPage(page, size);
        return new PageInfo<>(groupChatMapper.selectAllGroup(name, time));
    }

    @Override
    public boolean updateGroupStatus(int status, Integer... id) {
        if (id != null) {
            groupChatMapper.updateGroupStatus(status, id);
        }
        return true;
    }
}
